package com.carpedil.smvc.controller;

import com.carpedil.smvc.po.User;
import com.carpedil.smvc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/** @author Administrator */
@RestController
public class UserController {
  @Autowired UserService userService;

  @RequestMapping("/user/{id}")
  public User getUser(@PathVariable("id") Integer id) {
    return userService.getUserById(id);
  }
}
